#include "app_buffer.h"
#include <stdio.h>

int main(int argc, char const *argv[])
{
    app_buffer_t *buffer=  app_buffer_init();
    app_buffer_write(buffer, "abcdabcd", 8);
    app_buffer_write(buffer, "mmmnnn", 6);

    char read_buf[20];
    int read_len= app_buffer_read(buffer, read_buf, 20);
    printf("read_len=%d, read_buf=%.*s\n", read_len, read_len,read_buf);

    read_len= app_buffer_read(buffer, read_buf, 20);
    printf("read_len=%d, read_buf=%.*s\n", read_len, read_len,read_buf);

    return 0;
}
